/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package vn.support.ui.frame;

import javax.swing.tree.DefaultMutableTreeNode;
import vn.support.core.dto.Staff;

/**
 *
 * @author nttuyen
 */
public class StaffMutableTreeNode extends DefaultMutableTreeNode {

    public StaffMutableTreeNode(Staff staff) {
        super(staff);
    }

    @Override
    public String toString() {
        if (userObject == null) {
            return null;
        } else if(userObject instanceof Staff){
            Staff staff = (Staff)userObject;
            return staff.getStaffName();
        }
        return userObject.toString();
    }
}
